﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace comdiinfo
{
    public class G64SizeOfTracks : G64Element<Int16>
    {
        public G64SizeOfTracks(int trackNo)
            : base(trackNo)
        {
            elementName = "Size of Tracks";
        }
        public override void LoadData(ref G64ImageData imgData, int srcOffset, int count)
        {
            ElementValue = BitConverter.ToInt16(imgData.readBytes(10, 2, elementName), 0);
        }
        public override void CheckValue()
        {
            // usually  7928,  or $1EF8 in LO/HI format.
            if (ElementValue == 7928)
            {
                elementStatus = G64ElementStatus.Ok;
            }
            else
            {
                elementStatus = G64ElementStatus.Error;
                elementStatusText.AppendFormat("{0} {1} ({2})", elementName, " muss 7928 sein!", ElementValue.ToString());
                elementStatusText.AppendLine();
            }
        }
    }
}
